package org.jeecg.modules.fxjdh.service.impl;

import org.jeecg.modules.fxjdh.entity.FxjDh12;
import org.jeecg.modules.fxjdh.entity.FxjDh1210;
import org.jeecg.modules.fxjdh.mapper.FxjDh1210Mapper;
import org.jeecg.modules.fxjdh.mapper.FxjDh12Mapper;
import org.jeecg.modules.fxjdh.service.IFxjDh12Service;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 收车记录
 * @Author: zhaodui
 * @Date:   2020-02-22
 * @Version: V1.0
 */
@Service
public class FxjDh12ServiceImpl extends ServiceImpl<FxjDh12Mapper, FxjDh12> implements IFxjDh12Service {

	@Autowired
	private FxjDh12Mapper fxjDh12Mapper;
	@Autowired
	private FxjDh1210Mapper fxjDh1210Mapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		fxjDh1210Mapper.deleteByMainId(id);
		fxjDh12Mapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			fxjDh1210Mapper.deleteByMainId(id.toString());
			fxjDh12Mapper.deleteById(id);
		}
	}
	
}
